/*
 * ActionResult.java July 2009
 *
 * Copyright (C) 2009, Quirino Zagarese <quirino@laszloitalia.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 */
package org.eu4ria;


/**
 * The Class OWResult.
 */
public class ActionResult {

	/** The type. */
	private Class<?> type;

	/** The value. */
	private Object value;

	private int paramErrorNum = -1;

	private String errorMessage;

	private StackTraceElement[] errorStackTrace;

	private String stackTraceString = "";

	public String getStackTraceString() {
		return stackTraceString;
	}

	public void setStackTraceString(String stackTraceString) {
		this.stackTraceString = stackTraceString;

	}

	/**
	 * Gets the type.
	 *
	 * @return the type
	 */
	public Class<?> getType() {
		return type;
	}

	/**
	 * Sets the type.
	 *
	 * @param class1 the new type
	 */
	public void setType(Class<?> class1) {
		this.type = class1;
	}

	/**
	 * Gets the value.
	 *
	 * @return the value
	 */
	public Object getValue() {
		return value;
	}

	/**
	 * Sets the value.
	 *
	 * @param value the new value
	 */
	public void setValue(Object value) {
		this.value = value;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public int getParamErrorNum() {
		return paramErrorNum;
	}

	public void setParamErrorNum(int paramErrorNum) {
		this.paramErrorNum = paramErrorNum;
	}

	public void setErrorStackTrace(StackTraceElement[] errorStackTrace) {

		this.errorStackTrace = errorStackTrace;
		if(errorMessage==null || errorMessage.equals("")){
			this.errorMessage =  errorStackTrace[0].toString();
		}
		for(StackTraceElement  element : errorStackTrace){
			stackTraceString = stackTraceString + element.toString() + "\n";
		}
	}

	public StackTraceElement[] getErrorStackTrace() {
		return errorStackTrace;

	}



}
